/*
class Person {
    public String name;
    public int age;

    public void eat()
    {
        System.out.println(this.name+"吃饭");
    }

    public void show(){
        System.out.println(this.name+","+this.age);
    }
}

public class Test {
    public static void main(String[] args) {
        Person person = new Person();
        System.out.println(person.age);
        person.show();
        person.eat();
    }
}*/

class Student {
    public String name;
    public int age;

    public static String classRoom = "121";

    public Student() {
        this("zhangsan",11);//这个语法只能出现在构造方法里
        System.out.println("S");
    }

    public Student(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public void show() {
        System.out.println(this.name + "," + this.age);
    }
}

public class Test {
    public static void main(String[] args) {
        Student student1 = new Student();
        Student student2 = new Student("wang",12);
        student1.show();
        student2.show();
        System.out.println(Student.classRoom);
        System.out.println(student1.classRoom);
    }
}







